package spring.boot.fastdep.jwt.service;

import org.springframework.stereotype.Service;
import spring.boot.fastdep.jwt.model.TUser;

import java.util.HashSet;
import java.util.Set;

@Service
public class TUserService {

    public TUser selectUserByUsername(String username) {
        if ("admin".equals(username)) {
            TUser tUser = new TUser();
            tUser.setId(1L);
            tUser.setUsername("admin");
            tUser.setPassword("e10adc3949ba59abbe56e057f20f883e");
            return tUser;
        }
        return null;
    }

    public Set<String> selectPermissionsByUserId(long userId) {
        return new HashSet<String>() {{
            add("hello");
        }};
    }
}
